home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / gcc / libnix.lha / gnu / lib / libnix / sources.lha / nix / setjmp / longjmp.c next >
Encoding:
Text File  |  1994-04-10  |  452 b   |  10 lines

  1. asm(".text                  ;" /* doing this in c is very hard */
  2.     ".even                  ;"
  3.     ".globl _longjmp        ;"
  4.     "_longjmp:              ;"
  5.     "  movel  sp@(4),a0     ;" /* get address of jmp_buf */
  6.     "  movel  sp@(8),d0     ;" /* get returncode */
  7.     "  moveml a0@(4),#0xfcfc;" /* restore all registers (including sp) except scratch */
  8.     "  movel  a0@,sp@       ;" /* restore returnaddress */
  9.     "  rts                  ;");
  10.